home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!news
- From: jlilley@ix.netcom.com (John Lilley)
- Newsgroups: comp.lang.c++
- Subject: Re: C++ experts only
- Date: 31 Mar 1996 00:17:14 GMT
- Organization: Netcom
- Message-ID: <4jkiua$pki@dfw-ixnews1.ix.netcom.com>
- References: <4jhrb4$gk2@melon.myna.com>
- NNTP-Posting-Host: den-co11-11.ix.netcom.com
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-NETCOM-Date: Sat Mar 30 6:17:14 PM CST 1996
- X-Newsreader: WinVN 0.99.7
-
- In article <4jhrb4$gk2@melon.myna.com>, ckhan@myna.com says...
- >
- >If you are such an expert, tell me why C++ is so great or not so great as
- >compared to Structured C.
-
- Golly, such an attitude... But it DID get an answer...
-
- One could be glib and claim that there are NO disadvantages to C++ vs C because
- C++ is a superset of C, but I don't that it what our dear friend is asking.
-
- One could also claim that C++ or any language is no better than the most
- primitive assembler because they are all (within resource limits),
- Turing-machine equivalent, but that is not the answer either, I fear.
-
- I assert that C++ is an improvement over C because:
-
- 1) It's type system and the safety guarantees therein are more complete and
- allows one to write more reliable code.
-
- 2) It is more powerful and requires less typing and other such tedium to
- express groupings of data and operations on data as classes instead of data
- structures and functions.
-
- 3) C++ provides a uniform framework of object creation and destruction
- regardless of the physical location (stack, heap or global). That uniform
- treatment reduces the number of loose ends that crop up when using objects that
- have various lifetimes.
-
- 4) Inheritance and the polymorphism supported by virtual methods are powerful
- constructs that reduce the amount of tedium and/or type-violations that are
- needed to express operations upon similar classes of objects.
-
- 5) Templates are great IMHO, because they allow one to write a type-safe
- container once and use it for many objects (although at the possible expense of
- code size).
-
- 6) Type-safe linkage reduces stupid errors due to mismatching of headers.
-
- 7) Overridable new/delete allow one to alter the behavior of memory allocation
- in a systematic manner.
-
- 8) Method/function inlining is as efficient as macros (in most cases), but does
- not suffer the semantic and syntactic nasty side-effects of macros.
-
- 9) Method inlining for access to data members is as efficient as a simple
- pointer-indirection, but allows for access protection or future upgrades to the
- access that are more complex than pointer-indirection.
-
- But this is all stuff you could have read in any intro to C++ book. I think
- that the reasons are compelling -- why not go buy some books and check it out
- for yourself?
-
- john lilley
-
-